Skip to content

Conversation

@qingyuan1109
Copy link
Contributor

@qingyuan1109 qingyuan1109 commented May 7, 2025

Context

Add support for MCP Server Instructions.
Roo Code can get and display the MCP Server's instructions and add it into the prompts.
The instructions is part of the mcp protocol from version 1.2 of @modelcontextprotocol/sdk and describes how to use the server and its features, so it can help LLM understand how to use MCP server correctly.

Implementation

  • When connecting to the mcp server, use the method getInstructions provided by the official sdk to obtain the instructions of the mcp server and save it in the array connections of McpHub
  • Display the instructions in McpView.tsx
  • When splicing prompts, add the instructions to the mcp-servers segment

Screenshots

MCP Server definition

截图_选择区域_20250508092517

before after

|
截图_选择区域_20250507154118
|
截图_选择区域_20250507150341
|

How to Test

  • Add a MCP Server that has set instructions
  • Check whether the instructions is displayed correctly on the mcp panel
  • Check if the mcp-servers segment of the prompts contains instructions

Get in Touch

[email protected]


Important

Adds support for fetching, displaying, and including MCP server instructions in prompts and UI.

  • Behavior:
    • Fetches MCP server instructions using client.getInstructions() in McpHub.ts and stores them in McpServer.
    • Displays instructions in McpView.tsx under each server's details.
    • Includes instructions in the MCP servers section of prompts in mcp-servers.ts.
  • Models:
    • Adds instructions field to McpServer type in mcp.ts.
  • UI:
    • Updates ServerRow in McpView.tsx to show instructions if available.

This description was created by Ellipsis for daa5715d12c3178098997371c5dd7efaf25371c0. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

⚠️ No Changeset found

Latest commit: f05ba92048f07909d64fdc6141118bdd17b6269d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels May 7, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 7, 2025
@jezweb
Copy link

jezweb commented May 7, 2025

Okay, here's the translation of the text in the image:

Top line (header/title area):

  • mcp-dev-helper-sse global
  • Icons (from left to right): Delete, Refresh, Toggle (on), Status (active/green)

Main text block:
"This MCP Server contains four resources, which correspond to four separate guides. They can be used individually and have no dependencies. When executing tasks, first analyze the user scenario, then select an appropriate resource to use."

Bottom tabs:

  • Tools (0)
  • Resources (4) (This tab is selected)

@sunsheng01
Copy link

I think this PR is helpful to us. The instructions field can help the LLM understand how to use the tools or resources in our MCP server, especially when the LLM is not particularly intelligent. So when will it be merged?

bgilbert6 pushed a commit to bgilbert6/Roo-Code that referenced this pull request May 14, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 27, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 31, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 31, 2025
@daniel-lxs
Copy link
Member

daniel-lxs commented May 31, 2025

Hey @qingyuan1109, thank you for your contribution.

This implementation looks solid, I'll make some minor changes to get this over the finish line:
I think a conditional tab for instructions might work better if the instructions are quite large:
image

Also I added a markdown header for the MCP prompt.

With these changes this PR is good to go.

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap May 31, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 2, 2025
@mrubens mrubens merged commit 98711d4 into RooCodeInc:main Jun 2, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Jun 2, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants